package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /**
     * 根据菜品id查询对应套餐
     * @param ids
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> ids);

    @Delete("delete from dish where id = #{id}")
    void deleteById(Long id);

    @Select("Select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getDishBysetmealId(Long id);

    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 删除套餐菜品
     * @param ids
     */
    void deleteBatch(List<Long> ids);
}
